package com.eduadmin.service;

import com.eduadmin.entity.CourseDivide;
import com.eduadmin.mapper.CourseDivideMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zlc001
 * */
@Service
public class CourseDivideServiceImpl implements ICourseDivideService{
    private final CourseDivideMapper courseDivideMapper;
@Autowired
    public CourseDivideServiceImpl(CourseDivideMapper courseDivideMapper) {
        this.courseDivideMapper = courseDivideMapper;
    }
    @Override
    public int batchInsert(List<CourseDivide> courseDivideList){
         courseDivideMapper.batchInsert(courseDivideList);
        return 1;
    }
    // 根据条件（学期&&年级&&考试&&分类&&学科英文名称）查找所有班级“指定学科”一分段记录，返回对象列表
    public List<CourseDivide> getAllCourseDivideByParams(Map<String,Object> paraMap){
        return courseDivideMapper.getAllCourseDivideByParams(paraMap);
    }
    // 根据条件（学期&&年级&&考试&&分类）删除所有的班级学科一分段记录，返回1
    public int deleteByParams(Map<String,Object> paraMap){
        courseDivideMapper.deleteByParams(paraMap);
        return 1;
    }
    // 返回满足条件的记录条数
    public int getAllCourseDivideNumberByParams(Map<String,Object> paraMap){
        return courseDivideMapper.getAllCourseDivideNumberByParams(paraMap);
    }
    // 根据条件（（不带分页条件）和 学期&&年级&&考试&&分类&&学科英文名称）查找所有班级“指定学科”一分段记录，返回对象列表
    // 用于图表和导出
    public List<CourseDivide> getAllCourseDivideForChartsByParams(Map<String,Object> paraMap){
     return courseDivideMapper.getAllCourseDivideForChartsByParams(paraMap);
    }
}
